existing branch and the specified remote branch git branch--set-upstream [branch] [remote-branch] # Merge the specified branch into the current branchgit merge [branch]# Select a commit, merge into the current branch git Cherry-pick [commit] # Delete Branchgit branch-d [branch-name]# Delete Remote branch Git push Origin--delete [Branch-name]git branch-dr [Remote/branch] Six, tag # list all tagsgit tag# Create a new tag in the current commitgit tag [tag]# Create a new tag in the specified commit
protected] {2}: WIP on pci-fix:02f8c6a Linux 3.0[Email protected] {3}: WIP on 3.0:02f8c6a Linux 3.0Git stash Save "name"Git stashBoth of these are the current changes, and if you have name, you can add a label that is easy to identify.Git stash apply is used to restore the most recent modification.git stash apply [email protected]{1} to restore the specified changes.git stash pop [email protected]{1} acts like Git stash apply.Git stash pop removes a record from the stash stack, and git stash ap
siteMulti-person collaborationGit remote # View remote branchesGit remote-V # View more detailed remote branch informationGit push origin master # push master branch to remoteTagIt is recommended to create tags for software releases. This concept already exists and also exists in SVN. Run the following command to create a label named 1.0.0:Git tag 1.0.0 1b2ffd63ffGit tag-d # delete a tagGit tag-a-m "commit info..." # specify tag information
Original URL:
Http://www.myexception.cn/mobile/1828171.html
How git will export all of the files that hit a tag.
http://segmentfault.com/q/1010000000129910
If your tag name is 1.0, you can export it in the following way.
1. Export and compress to ZIP format:
$ git archive--format=zip--output=v1.0.zip 1.0
2. Export and compress to TAR.BZ2 format:
$ Git Archive 1.0 | bzip2 > v1.0.tar.bz2
3. Export and compress to tar.gz format:
$ git Archive--format=tar 1.0 | gzip > v1.0.tar.gz
View the
branches renamed:
git branch-m master MyMaster-M capital M overrides a branch merge branch with the same name:
Direct Merge:Git merge the source branch name that you want to merge into the current branchgit merge-no-commit branch//merge but do not commit
Press-Fit Merge: The branch is pressed into a commit record and merged.git Merge-squash a bug branchGit commit-m "fix a Bug"
Picking Merge: Merge only one commitGit Cherry-pick 321d76fIf sequential picking is required, you need to add the-n par
submit the current code to the server3> directly switch to the v1.0bugfix branch and revise the V1.0 bug. After the modification is complete, submit the code.4> after the manager approves the code, the modified Code is integrated into the master line.5> Add v1.1 labels to the Manager# Add the v1.0 tag at the current time pointGit tag a v1.1-m "Version 1.0"# Push the v1.0 tag to the remote code libraryGit push origin v1.1# Deleting a remote BranchGit push origin -- delete V1.0bug _ fix6> User01
) Marking the labelgit tag-a v1.0.0-m "my version v1.0.0"(3) View a tagGit show v1.0.0(4) Delete a tagGit tag-d v1.0.0(4) Push the tag to the remoteGit push Origin--tags12. CompareThe difference between git diff Workspace (W) and staging Area (I)The difference between the git diff HEAD Workspace (W) and the local repository (L)The difference between git diff--staged staging area (I) and the local repository
' # Add and commit as one step git rm xxx # Delete in index File git rm-r * # recursive delete git log # Show Commit log git log-1 # shows 1 rows of log-n for n-line git log-5git log--stat # Show commit log and related changes file Git log-p-mgit show dfb02e6e4f2f7b573337763e5c0013802e392818 # show A Commit Git show DFB02 # c
, the version number of the sub-warehouse is referenced in its parent warehouse i18n-www, and the reference record is push origin, causing other clients to fail to update.Workaround, perform a git submodule update on other clients after the I18n-php-server repository is push origin on computer A. Or, using the Git reset method mentioned above, restore the reference version number of the sub-repository to the latest version number that exists on Origin.Other questions
Set the local branc
related changes fileGit log-p-MGit show dfb02e6e4f2f7b573337763e5c0013802e392818 # shows the details of a commitGit show DFB02 # can only use the first few CommitidGit show Head # show head commit logGit show head^ # shows the parent of the HEAD (previous version) of the commit log ^^ to 5 versions on the previous two versions ^5git tag # shows the existing taggit tag-a v2.0-m ' xxx ' # Add v2.0 tagGit Sho
#1 line of log display-n is n lines of git log-5git log -- stat # displays the commit log and related change files git log-p-mgit show dfb02e6e4f2f7b573337763e5c001380 2e392818 # display the details of a submission git show dfb02 # only the first few git show heads of commitid can be used # display the HEAD commit log git show HEAD ^ # display the parent of the HEAD (Previous Version) commit log ^ for the previous two versions ^ 5 for the previous five versions git tag # show the existing
userinterfacestate.xcuserstate in GitHttp://www.tuicool.com/articles/JjIZFnIAdd: When you have pod management, you should do it again with the userinterface path in the pod.Here are some specific action scenarios:1. Delete a branchDelete a remote branch (two types are available )Git push Origin--delete Branch_namegit push origin:branch_name Delete local BranchGit branch-d branch_name2. New BranchNew local BranchGit branch Branch_namePushing a local branch to a remote branch is equivalent to cr
remoteGit push Origin branch-name no conflict or resolve conflict, push will succeedCreate a labelgit tag v1.0 hit a new taggit tag v0.9 6224937 find a History version ID, fill taggit tag View all tagsGit show v0.9 view tag detailsgit tag-a v0.1-m "version 0.1 released" 3628164 Create label with description, specify label name with-A,-m specify description textgit tag-d v0.1 tag is wrong or can be deletedG
local temporary branch, and then merge the changes on the local branch into this temporary branch, then initialize the local branch with this temporary branch)3.8. Git diffCompare the local code with the code in index, or compare the code in index with the code in the local warehouse.1 Git diffCompare the working directory and the code in index.2 Git diff--CachedCompare the code in index and local warehouses.3.9 Git Checkout3.9.1. Switch to Branch1 Create a new branch and switch to the branchGi
, fortunately, because your local warehouse and remote warehouse is equivalent, you just need to restore the local warehouse, and then force push to the remote repository:git reset--hard HEADGit push-fSummarize:Revocation of the above 4 states we all use the same command git reset--hard, the first 2 states are used even exactly the same, so as long as the git reset--hard the use of this command, you never have to worry about committing errors.This article then contributes other GIT commands:git
dev1 a651ed5 Merge Branch'B2'0f7c6c7 Merge Branch'B1'99171bd Modify Ignore config file d379649 Add custom ignore file c568160 deleted B1.txt1862163Modify 9833ae7 Add a line on B2 branch 0e07e62 modify b1.txt 1a0cfa7 Modify B1 24549b6 modify files
9181725Modify Files f46e95b add a line on B2.txt 51ef312 add b2.txt on branch B1 55cedea add a line on B1.txt 38 fb557 add B1.txt on B1 branch 058c2f7 add a.php cec4d7c update readme.md cfbb500 update readme.md 04ec1f4 Ini Tial Committag for a com
When we publish a version, we usually start with a tag (tag) in the repository, so that it is the only version that determines the time of the tag. Any time in the future, the version of a tag is taken out of the historical version of that tag. Therefore, the tag is also a snapshot of the repository.Add Tag: $git tag Label signatureView Tags: $git taggit tag -a Label information can be specified;Delete tag: $git tag-d label SignaturePush tags to the f
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.